package com.jiazhong.常用类.String;

import java.util.Locale;

public class Text03 {
    public static void main(String[] args) {
        String s=new String("Call Me Ishmael");
        System.out.println(s);
        System.out.println(s.length());
        System.out.println(s.charAt(0));
        System.out.println(s.charAt(s.length()-1));
        String x = s.substring(s.indexOf("C"), s.indexOf(" "));
        System.out.println(x);
        System.out.println(s.substring(5,7));
        String z=s.substring(s.lastIndexOf("I"),s.lastIndexOf("l"));
        System.out.println(z+" "+s.substring(5,7)+" "+x);
        String y=s.substring(5,7);
        String empty;
        System.out.println("降序:");
        if (x.compareTo(y)>0){
            if (x.compareTo(z)>0){
                System.out.println(x);
                System.out.println(z);
            }else {
                System.out.println(z);
                System.out.println(x);
            }
            System.out.println(y);
        }else {
            if (y.compareTo(z)>0){
                System.out.println(y);
                System.out.println(z);
            }else {
                System.out.println(z);
                System.out.println(y);
            }
            System.out.println(x);
        }
        System.out.println("=============");
        System.out.println(s.toUpperCase());
        System.out.println(s.toLowerCase());
        System.out.println("==============");
        System.out.println(s.contains("me"));
        System.out.println(s.startsWith("Call"));
        System.out.println(s.endsWith("l"));
        String str="   wellcome to jiazhong   ";
        System.out.println(str.trim());
    }
}
